module.exports = {
	name: 'Balance',
	data() {
		return {
			userAccount: 0
		}
	},
	props: {
		title: {
			type: String,
			default: ''
		},
		showManageBtn: {
			type: Boolean,
			default: false
		},
		menuItem: {
			type: Array,
			default: []
		}
	},
	methods: {
		onToManage() {
			this.$emit('manage');
		},
		handleCommand(command) {
			this.$emit(command);
		},
		getBalance(opt) {
			return new Promise((resolve, reject) => {
				let data = this.$$formData(opt);

				this.$$api_manager_balance(data, res => {
			        if(res.event === 0) {
			        	this.userAccount = res.obj;
			        	resolve(money)
			        }else {
			            cbs.submitError.call(this, `获取余额信息失败，${res.msg}`);
			            this.userAccount = 0;
			            reject(res.obj)
		            }
	   	            this.$emit('callback', res.obj);
		        })
			})
		}
 	},
}